package com.situ.mall.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.situ.mall.pojo.vo.UserFavoriteProductVO;
import com.situ.mall.service.IEchartsService;
import com.situ.mall.util.Result;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

@RestController

public class EchartsController {
    @Autowired
    private IEchartsService echartsService;

    @RequestMapping("/echarts")
    public Result userFavoriteProduct(){
        System.out.println("EchartsServlet.service");
        List<UserFavoriteProductVO> list = echartsService.UserFavoriteProduct();
        return Result.ok(list);
    }
}